#include<iostream>
using namespace std;
int main()
{
	int i,j;
	int n = 4, v = 0;
	int a[4][4];
	for (j = 0; j < 4; j++) {
	for (i = 4 - n; i < 4; i++)
		a[i][j] = ++v;
		n--;
	}
	for (i = 0; i < 4; i++) {
		for (j = 0; j < 4; j++) {
			a[i][j] = a[j][i];
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}
